<template>
	<!-- 头部标签 -->
	<view class="head displayFlex" :style="{height:winInfo.height-25+'px',paddingTop:winInfo.top-15+'px'}">
		<image @tap="returnTap" style="width: 34rpx" src="/static/return.png" mode="widthFix">
		</image>
		<text>预约处理</text>
	</view>
	<view class="" :style="{ height: winInfo.height + 'px', paddingTop: winInfo.top +50 + 'px' }">

		<view class="applyBox">
			<view class="displayFlexSpaceBetween">
				<view class="applyBoxc">
					申请人数
				</view>
				<view class="applyBox-right">
					10人
				</view>
			</view>
			<view class="">
				2025
			</view>

		</view>
		<view class="activityBox">
			<view class="activityBox-Box">
				<view class="displayFlexSpaceBetween">
					<view class="activityBox-Box-Text">
						小场5v5飞盘 新手场
					</view>
				</view>
				<view class="activityBox-Box-header displayFlex">
					<image src="/static/images/tabbar/dabai.png" mode=""></image>
					<text>栖木社-官方活动</text>
					<text>#100人夸 #已团10场 #飞盘</text>
				</view>
				<view class="activityBox-Box-apply">
					<text class="">
						报名中
					</text>
					<text>6月25日</text>
					<text>周三</text>
					<text>18：00</text>
					<text>|</text>
					<text>10km</text>
					<text>倾城绿茵中心</text>
				</view>
				<view class="displayFlexSpaceBetween ">
					<view class="activityBox-Box-left displayFlex">
						<image src="/static/images/my/icon-预约数@2x.png " mode=""></image>
						<text>预约数 10人</text>
					</view>
					<view class="activityBox-Box-right displayFlex" @tap="unfoldTap()">
						<text>{{unfoldShop==true?'展开':'收起'}}</text>
						<image
							:src="unfoldShop==true?'/static/images/my/icon-展开@2x (1).png':'/static/images/my/icon-展开@2x.png'"
							mode=""></image>
					</view>

				</view>
				<view class="" v-show="!unfoldShop">
					<view class="activityBox-Box-headerNumber displayFlexSpaceBetween" v-for="(item,index) in list"
						:key="index">
						<view class=" displayFlex">
							<image :src="item.picUrl" mode=""></image>
							<view class="">
								<view class="activityBox-Box-headerNumber-name displayFlex">
									{{item.name}}
									<image src="/static/images/my/icon-女@2x.png" mode=""></image>
									<!-- <image src="/static/images/my/icon-男@2x.png" mode=""></image> -->
								</view>
								<view class="activityBox-Box-headerNumber-laber singleLine">
									{{item.title}}
								</view>
							</view>
						</view>
						<view class="">
							<text style="color: #FB353B;" v-if="item.stay=='待同意'">待同意</text>
							<text style="color: #999999;" v-if="item.stay=='已同意'">已同意</text>
							<text style="color: #999999;" v-if="item.stay=='已拒绝'">已拒绝</text>
						</view>

					</view>
					<view class="activityBox-Box-headerNumber-more" @tap="moreTap()">
						前往查看更多 <image src="/static/images/my/箭头@2x.png" mode=""></image>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				unfoldShop: true,
				winInfo: {
					height: 64, //header高度
					top: 26, //标题图标距离顶部距离
					scrollH: 0 //滚动总高度
				},
				// 礼包服务数据
				list: [{
						title: '分享一些职场小技分享一些职场小技巧分享一些职场小技巧分享一些职场小技巧巧',
						time: '2028-4-22',
						name: '查看s',
						stay: '待同意',
						picUrl: 'https://images.unsplash.com/photo-1513475382585-d06e58bcb0e0?w=500&h=400&fit=crop' // 礼品盒图片
					},

					{
						title: '礼包服务',
						time: '2028-3-18',
						name: '宝宝',
						stay: '已同意',
						picUrl: 'https://images.unsplash.com/photo-1498837167922-ddd27525d352?w=500&h=400&fit=crop' // 食物图片
					},
					{
						title: '【1月20日】习近平对新型冠状病毒感染的肺炎1月20日】习近平对新型冠状病毒感染的肺炎',
						time: '2028-12-28',
						name: '更多',
						stay: '已拒绝',
						picUrl: 'https://images.unsplash.com/photo-1544551763-46a013bb70d5?w=500&h=400&fit=crop' // 帆船图片
					}, {
						title: '礼包服务',
						time: '2028-3-18',
						name: '宝宝',
						stay: '待同意',
						picUrl: 'https://images.unsplash.com/photo-1498837167922-ddd27525d352?w=500&h=400&fit=crop' // 食物图片
					}, {
						title: '分享一些职场小技分享一些职场小技巧分享一些职场小技巧分享一些职场小技巧巧',
						time: '2028-4-22',
						name: '查看s',
						stay: '已同意',
						picUrl: 'https://images.unsplash.com/photo-1513475382585-d06e58bcb0e0?w=500&h=400&fit=crop' // 礼品盒图片
					},

					{
						title: '【1月20日】习近平对新型冠状病毒感染的肺炎1月20日】习近平对新型冠状病毒感染的肺炎',
						time: '2028-12-28',
						name: '更多',
						stay: '已拒绝',
						picUrl: 'https://images.unsplash.com/photo-1544551763-46a013bb70d5?w=500&h=400&fit=crop' // 帆船图片
					},
				],
			}
		},
		mounted() {
			let obj = {}
			// #ifdef MP-WEIXIN
			obj = wx.getMenuButtonBoundingClientRect()
			// #endif
			// #ifdef MP-BAIDU
			obj = swan.getMenuButtonBoundingClientRect()
			// #endif
			// #ifdef MP-ALIPAY
			my.hideAddToDesktopMenu()
			// #endif
			// #ifdef MP-WEIXIN
			setTimeout(() => {
				uni.getSystemInfo({
					success: res => {
						this.winInfo = res
						this.winInfo.width = obj.left || res.windowWidth
						this.winInfo.height = obj.top ? obj.top + obj.height + 8 : res
							.statusBarHeight + 44
						this.winInfo.top = obj.top ? obj.top + (obj.height - 32) / 2 : res
							.statusBarHeight + 6
		
						this.winInfo.scrollH = res.windowWidth
						this.winInfo.bottom = res.windowHeight
						console.log('信息：', res)
						console.log('底部信息：', this.winInfo.bottom)
					}
				})
			}, 0)
			this.loading = false
			// #endif
		},
		methods: {
			unfoldTap() {
				setTimeout(() => {
					this.unfoldShop = !this.unfoldShop; //关闭显示弹出框
				}, 100)
				console.log('展开');
			},
			moreTap() {
				uni.navigateTo({
					url: '/packageA/MyAppointment/ApplicationLst'
				})
			},
			returnTap() {
				uni.navigateBack({
					delta: 1
				});
			},
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #F7F7F7;
	}

	.applyBox {
		background: #FFFFFF;
		border-radius: 0rpx 0rpx 16rpx 16rpx;
		padding: 25rpx 30rpx;

		&-left {
			font-weight: 800;
			font-size: 32rpx;
			color: #444444;
		}

		&-right {
			font-weight: 500;
			font-size: 28rpx;
			color: #444444;
		}
	}

	.activityBox {
		margin: 20rpx;

		&-Box {
			margin-top: 16rpx;
			padding: 25rpx;
			background: #FFFFFF;
			border-radius: 16rpx;

			&-Text {
				font-weight: 800;
				font-size: 36rpx;
				color: #333333;
			}

			&-left {
				font-weight: 500;
				font-size: 24rpx;
				color: #FF7F83;

				image {
					margin-right: 10rpx;
					width: 30rpx;
					height: 30rpx;
				}
			}

			&-right {
				image {
					margin-left: 10rpx;
					width: 20rpx;
					height: 20rpx;
				}

				font-weight: 500;
				font-size: 24rpx;
				color: #FF7F83;
			}

			&-header {
				margin: 20rpx 0;

				image {
					width: 44rpx;
					height: 44rpx;
					border-radius: 50%;
				}

				text:nth-of-type(1) {
					font-weight: 800;
					font-size: 26rpx;
					margin: 0 15rpx;
					background: linear-gradient(to right, red, blue);
					-webkit-background-clip: text;
					background-clip: text;
					color: transparent;
				}

				text:nth-of-type(2) {
					font-weight: 800;
					font-size: 26rpx;
					color: #FF7F83;
				}
			}

			&-headerNumber {
				background: #F7F7F7;
				border-radius: 16rpx;
				padding: 25rpx;
				margin: 20rpx 0;
				font-weight: 500;
				font-size: 30rpx;

				&-more {
					text-align: center;
					font-weight: 500;
					font-size: 28rpx;
					color: #666666;

					image {
						width: 20rpx;
						height: 20rpx;
						margin-left: 5rpx;

					}
				}

				image {
					width: 88rpx;
					height: 88rpx;
					border-radius: 50%;
					margin-right: 16rpx;
				}

				&-name {
					color: #333333;

					image {
						margin-left: 15rpx;
						width: 28rpx;
						height: 28rpx;
					}
				}

				&-laber {
					width: 350rpx;
					margin-top: 8rpx;
					font-size: 24rpx;
					color: #666666;
				}

			}

			&-apply {
				font-weight: 500;
				font-size: 24rpx;
				color: #212121;
				margin-bottom: 25rpx;

				text:nth-of-type(1) {
					font-weight: 500;
					font-size: 24rpx;
					color: #FB353B;
					padding: 4rpx 8rpx;
					background: #FFE9E9;
					border-radius: 6rpx;
				}

				text {
					margin-right: 15rpx;
				}
			}
		}
	}
	.head {
		position: fixed;
		left: 0;
		width: 100%;
		top: 0;
		z-index: 100;
		// background-color: #1F9A4F;
		// background-color: #fff;

		image {
			margin: 0 0rpx 0 30rpx;
		}

		text {
			font-weight: 800;
			font-size: 34rpx;
			color: #333333;
		}
	}
</style>